package edu.cmu.javadb;

import java.util.*;

import edu.cmu.javadb.exceptions.*;
import edu.cmu.javadb.plan.*;
import edu.cmu.javadb.plan.condition.*;

public interface Queryable<T> {
	Queryable<T> filter(Condition cond);
	<T2> Queryable<T2> project(Path path) throws NotProjectableException;
	<T2> Queryable<T> join(Queryable<T2> c2, Path p1, Path p2);
	<T2> Queryable<T2> flatten() throws NotFlattenableException; //actually you can give a exact generic type, but it seems no way to do that
	<S> S reduce(ReduceFn<S, T> fn);
	<K> VTable<K, T> groupBy(Path path);
	Collection<T> execute(); 
	Queryable<T> union(Queryable<T> ... args);
	PlanNode getPlan();
}
